
def d(n):
    ret = 0
    for i in range(1, n):
        if n % i == 0:
            ret += i
    return ret

abundant = []
for i in range(1, 28123):
    if d(i) > i:
        abundant.append(i)

print 'abundant:', len(abundant)

all = range(1, 28124)
for i in abundant:
    for j in abundant[abundant.index(i):]:
        try:
            all.remove(i + j)
        except:
            pass
print sum(all)

